include 4pp/lib/standard.4pp

:macro _fac >4> >3> @minus @add @sign @if @drop >3> @mul >3> >>> 1 @add <3< _fac ;
:macro @fac >>> 1 @swap >>> 1 @add >>> 2 @max <4< >>> 2 <3< _fac ;
:macro factorial >#> @fac @drop <1< #1# ;

." 10! = " factorial 10 . cr
